//
//  CircleView.m
//  IDLFaceSDKDemoOC
//
//  Created by Tong,Shasha on 2017/8/31.
//  Copyright © 2017年 Baidu. All rights reserved.
//

#import "CircleView.h"


@interface CircleView ()

@property (nonatomic ,strong)UIImageView *faceImageView;

@end

@implementation CircleView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        
        CGFloat width = ScreenWidth - 100;
        CGFloat height = (width*712)/515;
        _faceImageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, NavBarHeight+30, width, height)];
        _faceImageView.image = [UIImage imageNamed:@"WechatIMG169"];
        [self addSubview:_faceImageView];
        
    }
    return self;
}

- (void)setConditionStatusFit:(BOOL)conditionStatusFit
{
    if (_conditionStatusFit != conditionStatusFit) {
        _conditionStatusFit = conditionStatusFit;
        
        __weak typeof(self) weakSelf = self;
        dispatch_async(dispatch_get_main_queue(), ^{
            [weakSelf setfaceimage];
        });
    }
    
}
- (void)setfaceimage{
    
    if (!self.conditionStatusFit) {
        
        _faceImageView.image = [UIImage imageNamed:@"WechatIMG169"];
        
    }else{
        _faceImageView.image = [UIImage imageNamed:@"WechatIMG170"];
    }
}

@end
